
import http from "@/utils/http";
import {BASE_URL,CLIENT} from '@/common/const';
// let type='0';
// let  headers= {
//   "Content-Type": "application/json; charset=UTF-8"
// };

/**
 * 股票搜索
 * @param {Object} params
 * @param {Number} params.path
 * @param {Number} params.pageSize - 请求条数
 * @param {String} params.name - 股票名称
 * @return {Promise} Array
 */
export  function getStockList(params){
  const url = "http://app.yueniucj.com/app/clickSearchContent.htm";
  const send = {
    searchType: 1,
    limit: 10,
    ...params
  };
  // const res = await fetch(`${url}?${
  //   fn.objToParamStr(send)
  // }`);
  // const {data} = await res.json();
  // return data;
  return http.get(url,send)
}
/** 根据产品id查询直播室信息-H5*/
export  function getRoom(option){
  const url = `${CLIENT}/client/room/info.htm`;
  const params = {
    ...option
  };
  return http.get(url, params);
}

/** app获取公告信息-H5*/
export function getInfo(option){
  const url = `${CLIENT}/client/room/notice/info.htm`;
  const params = {
    roomId: 2,
    ...option
  };
  return http.get(url,  params );
  
}

/** 直播内容列表*/
export function getLiveList(option){
  const url = `${CLIENT}/client/room/content/info.htm`;
  const params = {
    roomId: 2,
    limit: 20,
    ...option
  };
  return http.get(url,  params );
  
}
/** 私信列表*/
export function getMsgList(option){
  const url = `${CLIENT}/client/room/msg/list.htm`;
  const params = {
    roomId: 2,
    limit: 20,
    userType: 0,
    ...option
  };
  return http.get(url, params);
  
}

/** 发布私信内容*/
export function postMsg(option){
  const url = `${CLIENT}/client/room/msg/pub.htm`;
  const params = {
    roomId: 2,
    ...option
  };
  return http.post(url, params);
  
}
/** 发布互动内容*/
export function postLive(option){
  const url = `${CLIENT}/client/room/msg/interaction.htm`;
  const params = {
    roomId: 2,
    ...option
  };
  return http.post(url, params);
}
/**直播相关推送*/
export function pushBroadcasting(option){
  const url = `${CLIENT}/client/pushBroadcasting.htm`;
  const params = {
    ...option
  };
  return http.post(url, params); 
}
/** 公告*/
export function getNotice(option){
  const url = `${CLIENT}/client/room/announcement/list.htm`;
  const params = {
    type: 1,
    limit: 20,
    ...option
  };
  return http.get(url,  params );
}
/** 精选列表*/
export function getFineList(option){
  const url = `${CLIENT}/client/room/fine/list.htm`;
  const params = {
    roomId: 2,
    limit: 20,
    ...option
  };
  return http.get(url,  params );
}




